<style lang="scss">
* {
  padding: 0;
  margin: 0;
}
</style>
<template>
  <el-config-provider :lang="zhCn">
    <router-view name="nav" v-slot="{ Component }">
      <div v-if="Component" class="fixed top-0 left-0 w-220px h-100vh">
        <component :is="Component" />
      </div>
    </router-view>
    <div
      :class="{
        'pl-220px': !!componentsDefine?.components.nav,
      }"
    >
      <router-view name="default" />
    </div>
  </el-config-provider>
</template>
<script lang="ts" setup>
import { last } from "lodash-es";
import zhCn from "element-plus/es/locale/lang/zh-cn";
const route = useRoute();

const componentsDefine = computed(() => {
  return last(route.matched) as any;
});
</script>
